package com.wzq.permission.center.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.wzq.permission.client.model.admin.DataPermissionModel;
import com.wzq.permission.client.model.admin.RoleDataPerissionModel;
import com.wzq.permission.client.model.admin.RoleModel;

/**
 * Role Mapper
 * @author Administrator
 *
 */
public interface RoleMapper extends BaseMapper {
	/**
	 * 根据系统id获取系统数据权限
	 * @param applicationId  系统id
	 * @return
	 */
	List<DataPermissionModel> queryApplicationDataList(@Param("applicationId")Long applicationId,@Param("rangeType")Integer rangeType);
	
	/**
	 * 根据roleid查询  数据权限id
	 * @param roleId
	 * @return
	 */
	List<Long> getRoleDataPerissionByRoleId(@Param("roleId")Long roleId);
	
	/**
	 * 根据roleId删除 数据
	 * @param roleId
	 */
	void deleteDataPerissionByroleId(@Param("roleId")Long roleId);
	/**
	 * 保存数据权限
	 * @param roleDataPerissionModelList
	 */
	void saveDataPerission(@Param("roleDataPerissionModelList")List<RoleDataPerissionModel> roleDataPerissionModelList);
	
	void logicDelete(@Param("roleIds")Long[] roleIds);
	
	/**
	 * 
	 * 判断角色是否存在   
	 * @author 陈剑飞    
	 * @Title: isExist    
	 * @param role
	 * @Return: int 返回值
	 */
	int isExist(RoleModel role);
	
	/**
     * 根据用户ID查询角色信息
     * @param userId 用户ID
     * @param applicationId 系统ID
     * @return List<RoleModel>
     */
    List<RoleModel> queryRoleByUserId(@Param("userId")Long userId,@Param("applicationId")String applicationId);
}
